---
layout: none
permalink: /start
---
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Ktor 项目生成器</title>
<style type="text/css">
    html, body { margin: 0; padding: 0; height:100% }
</style>
</head>
<body>

<div id="generator_id" style="width:100%;height:100%;"></div>

<script type="text/javascript">
    window.addEventListener('popstate', function(event) {
        const iframe = document.getElementById('iframe_generator');
        if (iframe) {
            iframe.contentWindow.postMessage({type: "updateHash", value: window.location.hash}, "*")
        }
    });
    window.addEventListener('message', function(event) {
        if (event.data && event.data.type === "updateHash") {
            history.pushState({}, "", window.location.pathname + "#" + event.data.value.replace(/^#/, ''));
        }
    });
    document.getElementById('generator_id').innerHTML = '<iframe id="iframe_generator" src="{{ site.ktor_init_tools_url }}' + location.hash.replace(/"/g, '\\"') + '" width="100%" height="100%" style="border:0;width:100%;height:100%;margin:0;padding:0;"></iframe>';
</script>
<noscript>
    本生成器需要 JavaScript 支持。
</noscript>

</body>
</html>
